1. Field of the Invention
The present invention relates to a method of and an apparatus for processing an image, and in particular, to a method of and an apparatus for processing an image in which a gradation is effectively corrected when a still image represented by a video signal is recorded in an image recording medium.
2. Description of the Prior Art
A still image recording apparatus has been proposed which receives a video signal read from an video signal recording medium, for example, a floppy disk or a video tape to reproduce a visual image on an image recording medium such as a sheet of photographic printing paper.
In such an apparatus, for example, red R, green G, and blue B signals respectively attained from the input video signal are sequentially delivered to a recording monochrome CRT having a high brightness. Before a display screen of the recording CRT, there is disposed a lens and a color-decomposing filter for separating 3 colors so as to focus an image displayed on the screen on a color printing sheet. Color components including cyan C, magenta M, and yellow Y are caused to be developed in the color printing sheet to obtain a color picture. In this case, the level must be inverted between the R, G and B signals attained from the input video signal and the signal to be supplied to the high-brightness monochrome CRT to develop the color elements C, M and Y. That is, for example, for a bright portion of an image of which the R, G and B signals have a high level, since the development of colors by the color components C, M, Y must be reduced to represent the brightness, the output level of the portion is required to be minimized.
Furthermore, for an image represented by an input video signal, since the density of each color is different from that of the actual object depending on, for example, the condition of illumination and the camera used to shoot the object, compensation is necessary in difference of the density. For example, even when the red, green and blue each have the same intensity with a white portion having the highest level in an actual object, the R, G and B signals received may respectively have different maximum levels in some cases. In such a situation, if the inputted R, G and B signals are directly used, for example, a portion which should be printed in white may be recorded on a recording medium with a color slightly shifted to any one of the red, green and blue due to the differences between the levels of the R, G and B signals.
To compensate for this phenomenon, a gradation correction has been achieved by use of a lookup table for each of the inputted R, G and B signals. Namely, a lookup table containing data of output levels associated with input signals is used to effect gradation correction, which further achieves the level reversing operation described above.
Conventionally, the data of the lookup table is established as follows.
For the R, G and B video signals attained from the input video signal, assuming points RH, GH and BH in the neighborhood of the highest points of the respective levels to represent a highlight point, and input video signal levels RH, GH and BH at the respective points are converted into the same density DH, which is a thin density similar to a density having the lowest level, thereby producing video signals at the same density.
Similarly, assuming points RS, GS and BS in the proximity of points having the respective lowest levels of the R, G and B video signals to represent a shadow point, input video signal levels RS, GS and BS at these points are converted into the same density D, which is a thin density in the vicinity of a density having the highest level, thereby producing video signals at the same level.
As described above, in a graph of an output density for an input video signal level, the highlight point and the shadow point are determined for each of the R, G and B signals, a curve is selected from a plurality of curves previously prepared, the curve having shortest distances to the highlight and shadow is selected then data on the selected curve are used as the data of lookup table to achieve the gradation correction. That is, for example, from a plurality of curves, a plurality of curves having the shortest distance to the highlight point are selected, and then from the selected curves, a curve having the smallest distance to the shadow point is selected.
The conventional lookup table data thus obtained by selecting a curve is obtained from the limited number of curves and hence it is not likely that the data when plotted correctly passes the highlight and shadow points; consequently, an error takes place, namely, for the gradation correction of an image represented by an input video signal, the lookup table data is not accurate.
Moreover, since data of many curves is stored, there arises a disadvantage that storage means with a large capacity is necessary.
The highlight and shadow points are attained, for example, by generating a cumulative histogram representing a frequency distribution of a video signal of each pixel in a frame of input video signals. For example, the highlight point is determined to be a point where a value of 99% is indicated in the cumulative histogram. That is, 99% of the input signals of the pixels have levels below the level of an input video signal associated with the highlight point.
Similarly, the shadow point is set to a point where a value of 1% is indicated in the cumulative histogram.
Consequently, in both cases where a portion of input video signals having a level in the vicinity of the level of the highlight point occupies a large area and a small area, the gradation is similarly established with the output density D in the neighborhood of the highlight point. However, since the gradation in the area near the highlight point greatly contributes to the picture quality of the overall picture, when there exists a large area having a level in the neighborhood of the level of the highlight point, the large-area portion attracts attention of the viewer of the recorded picture; consequently, it is desirable to correct the gradation to a high degree the large-area portion so that the level difference of the input video signals is magnified in the representation in terms of the output density. On the other hand, when there exists a small area having a level in the neighborhood of the level of the highlight point, the small-area portion does not attract attention of the viewer of the recorded picture and hence it is desirable not to take much account of the gradation in the small-area portion so that the level difference of the input video signals is reduced in the representation in terms of the output density, thereby producing a hard gradation in the overall picture.
In order to change the gradation in the output density depending on the area in the vicinity of the highlight point, the highlight point must be established in consideration of the area in the neighborhood of the highlight point. Similarly, the area must be taken into consideration to set the shadow point.
Conventionally, however, since the highlight and shadow points are respectively fixedly set to the 99% and 1% points in the cumulative histogram as described above, an appropriate gradation correction cannot be effected with the area taken into consideration.
Moreover, since the highlight and shadow points are set only to the 99% and 1% points in the cumulative histogram, when the number of sampling points is reduced to generate the cumulative histogram, the highlight and shadow points are under the influence of noise and contour emphasis, which prevents a proper gradation correction.
On the other hand, in a method in which reference is made to the overall frequency distribution in a histogram to attain a normalized distribution in the histogram, an area with an intermediate density is also referenced, which leads to a strong dependency on a scene and hence to an unnatural picture; consequently, the correct color balance cannot be developed in many cases.
Incidentally, the data of the lookup table in a case where a picture includes a white portion is set as follows. Namely, for each of the R, G and B input signals, assuming the point at the highest level and the point at the lowest level to be respectively the highlight and shadow points, the same output levels are obtained at the highlight and shadow points, respectively. With this provision, for the white portion, the R, G and B signals are produced with the same intensity and hence a white area is obtained.
However, for example, when shooting an object by means of an electronic still camera, an input video signal is generally subjected to processing to emphasize the contour. As a consequence, when a cumulative histogram is generated from the video signal of each pixel contained in the input video signal, the cumulative histogram includes influence from a pixel of which the level has been changed due to the contour emphasis, which interferes with correctly determining the highlight and shadow points.
Furthermore, since the input video signal is ordinarily mixed with a noise, the cumulative histogram is also under the influence of noise, which leads to a disadvantage also in this regard that the determination of the highlight and shadow points cannot be appropriately effected.
Incidentally, there has been a method of generating a lookup table to correct the gradation of the R, G and B signals in which the cumulative histogram is generated from the luminance signal Y of the input video signal to attain the highlight and shadow points from the histogram associated with the luminance signal Y so as to use these points as the highlight and shadow points of the R, G and B signals. In the use of this method, since the differences between the R, G and B signals contained in the input video signal are not considered, the difference of the color tone cannot be corrected between the input signal and the actual object.
Furthermore, there has been a method of generating a lookup table to correct the gradation of the R, G and B signals in which a cumulative histogram is generated for each of the R, G and B signals obtained from the input video signal to determine the highlight and shadow points by use of the generated histograms. According to this method, in a case, for example, where a portion having a considerably high level exists in the R signal, namely, where a bright portion is found in an image, the highlight point of the R signal is set to a higher value when compared with those of the G and B signals and hence the intensity of the output signal of the R signal is lowered; consequently, the complementary color with respect to the R signal, namely, cyan C is strengthened in the recorded picture to lose the color balance.
In other words, according to this method, although there is no problem in a case where a picture represented by the input video signal includes a pure white portion, if the picture does not have such a white portion and there exists a high-level input signal for a pure color with a high chroma saturation, the influence described above is caused to appear by the input signal and hence a picture for which the gradation corrected with the lookup table has an unsatisfactory color balance. That is, the correction of the gradation with the established lookup table results in an over-correction and the tone of the picture differs from that of the actual object.